package com.day31;

public class Time {
    private int hour;
    private int minute;
    private int second;

    //通过get方法返回出去
    public int getHour(){
        return hour;
    }
    //通过set方法赋值（修改）操作
    public void setHour(int hour) {
        if (hour>24||hour<0){
            this.hour=-1;
        }else{
            this.hour=hour;
        }
    }

    public int getminute(){
        return minute;
    }

    public void setminute(int minute) {
        //this.minute = minute;
        if (minute>60||minute<0){
            this.minute=-1;
        }else{
            this.minute=minute;
        }
    }

    public int getsecond(){
        return second;
    }

    public void setsecond(int second) {
        this.second = second;
    }
}
